import axios from "@/axios"

//获取视频资源
export function LoadVideo (data) {
  let { sortId, pageSize, currentPage } = data
  return axios.post(`/loadVideo/${sortId}/${pageSize}/${currentPage}`, {})
}

//删除当前行视频
export function DelVideo (data) {
  let { id } = data
  return axios.post(`/delVideo/${id}`, {})
}

//发布文档
export function ReleaseVideo (data) {
  let { sortId, videoIdList } = data
  return axios.post(`/releaseVideo/${sortId}`, videoIdList)
}

//控制文档位置
export function UpdateVideoReorder (data) {
  return axios.post(`/updateVideoReorder`, data, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

//新增视频
export function UpLoadVideo (sortId, formData) {
  return axios.post(`/upLoadVideo/${sortId}`, formData, {
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    timeout: 100000
  })
}


//编辑视频
export function UpdateVideo (videoId, formData) {
  return axios.post(`/updateVideo/${videoId}`, formData, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}


